#include <cstdlib>
#include <iostream>

using namespace std;

/**
 * power - Calculate the power of number.
 * @param base: Base value.
 * @param exponent: Exponent value.
 *
 * @return base raised to the power exponent.
 */
double power(double base, int exponent) {
    if (exponent == 0) {
        return 1;
    }

    double result = base;
    for (int i = 1; i < exponent; i++) {
        result *= base;
    }

    return result;
}

int main(int argc, char *argv[]) {
    if (argc != 3) {
        cout << "Usage: " << argv[0] << " base exponent" << endl;
        exit(EXIT_SUCCESS);
    }

    auto base = stod(argv[1]);
    auto exponent = stoi(argv[2]);
    auto result = power(base, exponent);
    cout << base << " ^ " << exponent << " is " << result << endl;

    return 0;
}
